//
//  File.swift
//  
//
//  Created by rui on 2024/7/11.
//

import Foundation

public extension DispatchQueue {
    private static var _onceTracker = [String]()
    class func jr_once(token: String, block closure: ()->Void) {
        objc_sync_enter(self)
        defer {
            objc_sync_exit(self)
        }
        if _onceTracker.contains(token) {
            return
        }
        _onceTracker.append(token)
        closure()
    }
}
